package com.hube.platform.tenant.entity.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.hube.platform.tenant.entity.po.base.SuperEntity;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * @author : Aaron
 * @date : 2022/6/2
 */
@TableName("tenant_database_config")
public class TenantDataBaseConfigPO extends SuperEntity {

    private String tenantId;
    private String tenantName;
    /**
     * 数据库名
     */
    private String databaseName;
    private String jdbcUrl;
    private String username;
    private String password;
    private String driverClassName;
    /**
     * 池中最多容纳多少连接（包括空闲的和在用的）
     */
    private int maximumPoolSize;
    /**
     * 最小空闲连接数
     */
    private int minimumIdle;
    /**
     * 连接超时时间:毫秒
     */
    private Long connectionTimeout;
    /**
     * 一个连接在池里闲置多久时会被抛弃，当 minimumIdle < maximumPoolSize 才生效
     */
    private Long idleTimeout;
    /**
     * 此属性控制池中连接的最长生命周期，值0表示无限生命周期，默认1800000即30分钟。
     */
    private Long maxLifetime;

    //0禁用，1启用
    private int status = 1;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getDatabaseName() {
        return databaseName;
    }

    public void setDatabaseName(String databaseName) {
        this.databaseName = databaseName;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public String getJdbcUrl() {
        return jdbcUrl;
    }

    public void setJdbcUrl(String jdbcUrl) {
        this.jdbcUrl = jdbcUrl;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getDriverClassName() {
        return driverClassName;
    }

    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }

    public int getMaximumPoolSize() {
        return maximumPoolSize;
    }

    public void setMaximumPoolSize(int maximumPoolSize) {
        this.maximumPoolSize = maximumPoolSize;
    }

    public int getMinimumIdle() {
        return minimumIdle;
    }

    public void setMinimumIdle(int minimumIdle) {
        this.minimumIdle = minimumIdle;
    }

    public Long getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(Long connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public Long getIdleTimeout() {
        return idleTimeout;
    }

    public void setIdleTimeout(Long idleTimeout) {
        this.idleTimeout = idleTimeout;
    }

    public Long getMaxLifetime() {
        return maxLifetime;
    }

    public void setMaxLifetime(Long maxLifetime) {
        this.maxLifetime = maxLifetime;
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this, ToStringStyle.JSON_STYLE);
    }
}
